import ReactDOM from 'react-dom/client';
import {RouterProvider} from 'react-router-dom';
import {IS_PROD} from '@/common/config';
import {router} from './router/index.client';
import '@/common/styles/index.scss';

window.addEventListener('error', e => {
    IS_PROD && e.preventDefault();
});

const App = <RouterProvider router={router} />;
const root = document.getElementById('root') as HTMLElement;
if (IS_PROD) {
    ReactDOM.hydrateRoot(root, App);
} else {
    ReactDOM.createRoot(root).render(App);
}
